package com.caiyouxi.partner.controller;

import com.caiyouxi.common.bean.ResData;
import com.caiyouxi.common.control.BaseController;
import com.caiyouxi.partner.model.ChannelContractBean;
import com.caiyouxi.partner.service.ChannelContractService;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by Administrator on 2017/11/21.
 */
@RestController
@RequestMapping("channel_contract")
public class ChannelContractController extends BaseController{

    private Logger logger = Logger.getLogger(ChannelContractController.class);

    @Autowired
    private ChannelContractService channelContractService;
    /**
     *获取渠道协议信息
     **/
    @RequestMapping("get_contract_info")
    public ResData get_contract_info(@RequestBody ChannelContractBean bean){
        logger.info("============================获取渠道协议信息============================");
        return channelContractService.get_contract_info(bean);
    }

    /**
     *获取渠道协议信息列表
     **/
    @RequestMapping("get_contract_list")
    public ResData get_contract_list(@RequestBody ChannelContractBean bean){
        logger.info("============================获取渠道协议信息列表============================");
        return channelContractService.get_contract_list(bean);
    }

    /**
     *新增渠道协议
     **/
    @RequestMapping("add_contract")
    public ResData add_contract(@RequestBody ChannelContractBean bean){
        logger.info("============================新增渠道协议============================");
        return channelContractService.add_contract(bean);
    }

    /**
     修改渠道协议
     **/
    @RequestMapping("update_contract")
    public ResData update_contract(@RequestBody ChannelContractBean bean){
        logger.info("============================修改渠道协议============================");
        return channelContractService.update_contract(bean);
    }

    /**
     *删除渠道协议
     **/
    @RequestMapping("delete_contract")
    public ResData delete_contract(@RequestBody ChannelContractBean bean){
        logger.info("============================删除渠道协议============================");
        return channelContractService.delete_contract(bean);
    }


}
